#include <string>

class CommandLineParmas {
public:
    CommandLineParmas(int argv, char **argc) {
        using namespace std;
        paramsCount = argv;
        stringParams = new string*[paramsCount];
        for (int i = 0; i < paramsCount; i++) {
            stringParams[i] = new string(argc[i]);
        }
    }
    bool paramExists(const char *param) {
        using namespace std;
        string youWant(param);
        for (int i = 0; i < paramsCount; i++) {
            if (0 == stringParams[i]->compare(youWant)) {
                return true;
            }
        }
        return false;
    }
    std::string getParam(const char *param) {
        using namespace std;
        string youWant(param);
        bool found = false;
        for (int i = 0; i < paramsCount; i++) {
            if (found) {
                return *stringParams[i];
            }
            if (0 == stringParams[i]->compare(youWant)) {
                found = true;
            }
        }
        return string();
    }
    int getParamsCount() {
        return paramsCount;
    }
    ~CommandLineParmas() {
        for (int i = 0; i < paramsCount; i++) {
            delete stringParams[i];
        }
        delete[] stringParams;
    }
private:
    int paramsCount;
    std::string **stringParams;
};
